/*
 *  The MIT License
 * 
 *  Copyright 2011 Edwin Bratini <edwin.bratini@gmail.com>.
 * 
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 * 
 *  The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 * 
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  THE SOFTWARE.
 */

/*
 * BaseBusquedaRapida.java
 *
 * Created on May 1, 2011, 9:53:56 PM
 */
package com.prebea.syscafil.ui;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;

/**
 *
 * @author Edwin Bratini <edwin.bratini@gmail.com>
 */
public class BaseBusquedaRapida extends JComponent {

    /** Creates new form BaseBusquedaRapida */
    public BaseBusquedaRapida() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bgrOpBusqueda = new javax.swing.ButtonGroup();
        pnlOpBusqueda = new javax.swing.JPanel();
        chkFiltro = new javax.swing.JCheckBox();
        rdbField1 = new javax.swing.JRadioButton();
        rdbField2 = new javax.swing.JRadioButton();
        rdbField3 = new javax.swing.JRadioButton();
        lblEntidades = new javax.swing.JLabel();
        scrEntidades = new javax.swing.JScrollPane();
        jtbEntidades = new javax.swing.JTable();
        btnBuscar = new javax.swing.JButton();
        txtBusqueda = new javax.swing.JTextField();
        btnSeleccionar = new javax.swing.JButton();

        pnlOpBusqueda.setBorder(javax.swing.BorderFactory.createTitledBorder("Opciones de Busqueda"));
        pnlOpBusqueda.setName("pnlOpBusqueda"); // NOI18N

        chkFiltro.setText("Filtro");
        chkFiltro.setName("chkFiltro"); // NOI18N
        chkFiltro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkFiltroActionPerformed(evt);
            }
        });

        bgrOpBusqueda.add(rdbField1);
        rdbField1.setSelected(true);
        rdbField1.setText("Field 1");
        rdbField1.setName("rdbField1"); // NOI18N

        bgrOpBusqueda.add(rdbField2);
        rdbField2.setText("Field 2");
        rdbField2.setName("rdbField2"); // NOI18N

        bgrOpBusqueda.add(rdbField3);
        rdbField3.setText("Field 3");
        rdbField3.setName("rdbField3"); // NOI18N

        javax.swing.GroupLayout pnlOpBusquedaLayout = new javax.swing.GroupLayout(pnlOpBusqueda);
        pnlOpBusqueda.setLayout(pnlOpBusquedaLayout);
        pnlOpBusquedaLayout.setHorizontalGroup(
            pnlOpBusquedaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlOpBusquedaLayout.createSequentialGroup()
                .addGroup(pnlOpBusquedaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlOpBusquedaLayout.createSequentialGroup()
                        .addComponent(rdbField1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(rdbField2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(rdbField3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(chkFiltro))
                .addContainerGap(17, Short.MAX_VALUE))
        );
        pnlOpBusquedaLayout.setVerticalGroup(
            pnlOpBusquedaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlOpBusquedaLayout.createSequentialGroup()
                .addComponent(chkFiltro)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlOpBusquedaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rdbField1)
                    .addComponent(rdbField2)
                    .addComponent(rdbField3)))
        );

        lblEntidades.setText("Entidades");

        scrEntidades.setName("scrEntidades"); // NOI18N

        jtbEntidades.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        scrEntidades.setViewportView(jtbEntidades);

        btnBuscar.setText("Buscar");
        btnBuscar.setName("btnBuscar"); // NOI18N

        txtBusqueda.setName("txtBusqueda"); // NOI18N

        btnSeleccionar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenes/ok.png"))); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(scrEntidades, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(pnlOpBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtBusqueda, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnBuscar))
                    .addComponent(btnSeleccionar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblEntidades, javax.swing.GroupLayout.Alignment.LEADING))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnSeleccionar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txtBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(btnBuscar, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE))
                            .addComponent(pnlOpBusqueda, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(21, 21, 21)
                        .addComponent(lblEntidades)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(scrEntidades, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void chkFiltroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkFiltroActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_chkFiltroActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup bgrOpBusqueda;
    private javax.swing.JButton btnBuscar;
    private javax.swing.JButton btnSeleccionar;
    private javax.swing.JCheckBox chkFiltro;
    private javax.swing.JTable jtbEntidades;
    private javax.swing.JLabel lblEntidades;
    private javax.swing.JPanel pnlOpBusqueda;
    private javax.swing.JRadioButton rdbField1;
    private javax.swing.JRadioButton rdbField2;
    private javax.swing.JRadioButton rdbField3;
    private javax.swing.JScrollPane scrEntidades;
    private javax.swing.JTextField txtBusqueda;
    // End of variables declaration//GEN-END:variables

    public ButtonGroup getBgrOpBusqueda() {
        return bgrOpBusqueda;
    }

    public JButton getBtnBuscar() {
        return btnBuscar;
    }

    public JCheckBox getChkFiltro() {
        return chkFiltro;
    }

    public JTable getJtbEntidades() {
        return jtbEntidades;
    }

    public JLabel getLblEntidades() {
        return lblEntidades;
    }

    public JPanel getPnlOpBusqueda() {
        return pnlOpBusqueda;
    }

    public JRadioButton getRdbField1() {
        return rdbField1;
    }

    public JRadioButton getRdbField2() {
        return rdbField2;
    }

    public JRadioButton getRdbField3() {
        return rdbField3;
    }

    public JScrollPane getScrEntidades() {
        return scrEntidades;
    }

    public JTextField getTxtBusqueda() {
        return txtBusqueda;
    }
}
